package com.nineclock.system.controller;

import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysCommonIndustryDTO;
import com.nineclock.system.service.SysIndustryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/industry")
@Api(value = "行业管理接口", tags = "行业服务")
public class SysIndustryController {

    @Autowired
    private SysIndustryService industryService;

    /**
     * GET:/sys/industry/list
     * @param parentId
     * @return
     */
    @GetMapping("list")
    @ApiOperation("查询行业列表")
    public Result<List<SysCommonIndustryDTO>> queryIndustryList(Long parentId){
        List<SysCommonIndustryDTO> industryList = industryService.queryIndustryList(parentId);
        return Result.success(industryList);
    }

}
